import { matchRoutes } from "react-router-config";
import { Redirect } from "react-router-dom";
import {
    Login,
    NotFound,
    QuestionManage,
    DiscussionGroupManage,
    AdminManager,
    UserManage,
    ArticleManage,
    DashBoard,
    AddAdmin,
    ArticleDetail
} from "../pages";


export const mainRouter = [
    {
        //登录页面
        pathname: '/login',
        component: Login
    },
    {
        pathname: '/404',
        component: NotFound
    }
]

export const adminRouters = [
    {
        pathname: '/admin/dashboard',
        component: DashBoard,
        title:'首页',
        isNav: true,
        exact:true,
        icon:1,//<DashboardOutlined />
        subNum: 1,
        role:['001','002','003'],
    },
    {
        pathname: '/admin/administrator',
        component: AdminManager,
        title:'管理员管理',
        isNav: true,
        exact:true,
        icon:2,//<TeamOutlined />
        subNum: 2,
        role:['001','002','003']
    },
    {
        pathname: '/admin/user',
        component: UserManage,
        title:'用户列表',  
        isNav: true,
        exact:true,
        icon:3,//<UserOutlined />
        subNum: 2,
        role:['001','002','003']
    },
    {
        pathname: '/admin/article',
        component: ArticleManage,
        title:'文章列表页面',
        isNav: true,
        exact:true,
        icon:4, //<SnippetsOutlined />
        subNum: 2,
        role:['001','002','003'],
    },
    {
        pathname: '/admin/question',
        component: QuestionManage,
        isNav: true,
        exact:true,
        title:'问题管理页面', 
        icon:5,//<QuestionCircleOutlined />
        subNum: 2,
        role:['001','002','003']
    },
    {
        pathname: '/admin/discussion-group',
        component: DiscussionGroupManage,
        title:'讨论组',
        isNav: true,
        exact:true,
        icon:6,//<SmileOutlined />
        subNum: 2,
        role:['001','002','003']
    },
    //文章审阅
    {
        pathname:'/admin/article_detail/:aid',
        component:ArticleDetail,
        title:"文章审阅页面"
    }
    

]